﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WeChatParking.Core.Payment.WeixinPay
{
    /// <summary>
    /// 微信JSAPI调用参数模型
    /// </summary>
    public class WxpayJSParams
    {
        /// <summary>
        ///  公众账号ID  appid  必填
        /// </summary>
        public string AppID { get; set; }

        /// <summary>
        /// 支付签名时间戳
        /// </summary>
        public string TimesTamp { get; set; }

        /// <summary>
        /// 支付签名随机串
        /// </summary>
        public string NonceStr { get; set; }

        /// <summary>
        ///  统一支付接口返回的prepay_id参数值，提交格式如：prepay_id=***）
        /// </summary>
        public string Package { get; set; }

        /// <summary>
        ///  签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
        /// </summary>
        public string SignType { get; set; }

        /// <summary>
        /// 支付签名
        /// </summary>
        public string PaySign { get; set; }

        public WxpayJSParams()
        {
            AppID = WxpayConfig.AppID;
        }

        public IDictionary<string, string> GetParameters()
        {
            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("appId", this.AppID);
            parameters.Add("timeStamp", this.TimesTamp);
            parameters.Add("nonceStr", this.NonceStr);
            parameters.Add("package", this.Package);
            parameters.Add("signType", this.SignType);
            //parameters.Add("sign", this.PaySign);
            return parameters;
        }


    }
}
